package org.netty.mvc.http;


import org.netty.mvc.entity.ParamProperties;
import org.netty.mvc.spring.ApplicationContext;
import org.netty.mvc.tool.NettyServer;
import org.netty.mvc.tool.PropertiesUtil;

/**
 * 服务的主入口
 *
 * @author superzhan
 */
public final class NettyApplication {

    //容器对象
    public static ApplicationContext applicationContext;

    public static void run(Class<?> configClass) {
        //初始化容器
        applicationContext = new ApplicationContext(configClass);
        //获取netty运行配置
        ParamProperties property = PropertiesUtil.getProperty();
        //启动Netty的http服务
        NettyServer.start(property);
    }

    //获取容器对象
    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }

}
